<template>
    <div class="file-wrapper">
        <img class="file-position" src="./bg.jpg" ref="imgSize" @onload="imgload">
    </div>
</template>

<script>
    export default {
        name: 'computeimg',
        data() {
            return {

            }
        },
        mounted(){
            let This = this

            document.querySelector('.file-position').addEventListener('load', function () {
                This.imgload();
            })
        },
        methods:{
            imgload(){
                let imgSize = this.$refs['imgSize'].offsetHeight;
                console.log(imgSize);
            }
        }
    }
</script>

<style scoped>
    img{
        width: 100%;
    }
</style>